package cn.com.huzo.model.entities.purchase;

import com.fasterxml.jackson.annotation.JsonFormat;
import huzofw.model.entities.BaseEntity;
import huzofw.model.entities.IAggregateRoot;
import java.io.Serializable;
import java.sql.Timestamp;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 对账单主记录实体类
 *
 * @author 吴旭
 */
public class NotesPayabledHeaderEntity extends BaseEntity implements Serializable, IAggregateRoot {

    private static final long serialVersionUID = -4586142230012123665L;
    private Long HeaderId;
    private String BillNo;                    // 单据号
    private Long SupplierId;                  // 供应商标识
    private String SupplierName;              // 供应商名
    private String YearOfBill;                // 对账年
    private String MonthOfBill;               // 对账月
    private Double TuckingCost;               // 运费
    private Timestamp CycleOfBillFrom;        // 对账周期开始
    private Timestamp CycleOfBillTo;          // 对账周期结束
    private String Description;               // 说明

    public Long getHeaderId() {
        return HeaderId;
    }

    public void setHeaderId(Long HeaderId) {
        this.HeaderId = HeaderId;
    }

    public String getBillNo() {
        return BillNo;
    }

    public void setBillNo(String BillNo) {
        this.BillNo = BillNo;
    }

    public Long getSupplierId() {
        return SupplierId;
    }

    public void setSupplierId(Long SupplierId) {
        this.SupplierId = SupplierId;
    }

    public String getSupplierName() {
        return SupplierName;
    }

    public void setSupplierName(String SupplierName) {
        this.SupplierName = SupplierName;
    }

    public String getYearOfBill() {
        return YearOfBill;
    }

    public void setYearOfBill(String YearOfBill) {
        this.YearOfBill = YearOfBill;
    }

    public String getMonthOfBill() {
        return MonthOfBill;
    }

    public void setMonthOfBill(String MonthOfBill) {
        this.MonthOfBill = MonthOfBill;
    }

    public Double getTuckingCost() {
        return TuckingCost;
    }

    public void setTuckingCost(Double TuckingCost) {
        this.TuckingCost = TuckingCost;
    }

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    public Timestamp getCycleOfBillFrom() {
        return CycleOfBillFrom;
    }

    public void setCycleOfBillFrom(Timestamp CycleOfBillFrom) {
        this.CycleOfBillFrom = CycleOfBillFrom;
    }

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    public Timestamp getCycleOfBillTo() {
        return CycleOfBillTo;
    }

    public void setCycleOfBillTo(Timestamp CycleOfBillTo) {
        this.CycleOfBillTo = CycleOfBillTo;
    }

    public String getDescription() {
        return Description;
    }

    public void setDescription(String Description) {
        this.Description = Description;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof NotesPayabledHeaderEntity)) {
            return false;
        }

        final NotesPayabledHeaderEntity that = (NotesPayabledHeaderEntity) o;

        return new EqualsBuilder()
                .append(this.getHeaderId(), that.getHeaderId())
                .isEquals();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public int hashCode() {
        int result = 17;
        result = 31 * result + getHeaderId().hashCode();

        return result;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this);
    }
}
